import React from 'react'
import {connect} from 'react-redux'

import HomeHeader from '../../components/HomeHeader'
import Category from '../../components/category'
import Add from './subpage/Add.jsx'
import List from './subpage/List.jsx'

class Home extends React.Component{
    constructor(props) {
        super(props)
    }
    render() {
        return (
            <div>
                <HomeHeader history={this.props.history} cityName={this.props.userinfo.cityName}></HomeHeader>
                <Category></Category>
                <div style={{height: '15px'}}></div>
                <Add></Add>
                <div style={{height: '15px'}}></div>
                <List cityName={this.props.userinfo.cityName}></List>
            </div>
        )
    }
}

function mapStateToProps(state){
    return {
        userinfo: state.userinfo
    }
}
function mapDispatchToProps(){
    return {
       
    }
}

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(Home)